﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestManagerClient.Pages
{
    public partial class ProfilePage : Page
    {
        public ProfilePage()
        {
            InitializeComponent();

            titleTextBlock.Text = "Profil";

            InformationDisplay.HideNotification(notificationGrid, notificationTextBlock);
            InformationDisplay.HideWarning(warningGrid, warningTextBlock);
            InformationDisplay.HideError(errorGrid, errorTextBlock);
        }

        #region Metody obsługujące przyciski zamknięcia informacji

        private void closeNotificationGridButton_Click(object sender, RoutedEventArgs e)
        {
            InformationDisplay.HideNotification(notificationGrid, notificationTextBlock);
        }

        private void closeWarningGridButton_Click(object sender, RoutedEventArgs e)
        {
            InformationDisplay.HideWarning(warningGrid, warningTextBlock);
        }

        private void closeErrorGridButton_Click(object sender, RoutedEventArgs e)
        {
            InformationDisplay.HideError(errorGrid, errorTextBlock);
        }

        #endregion

        #region Metody obsługujące przyciski testowe

        private void testNotificationButton_Click(object sender, RoutedEventArgs e)
        {
            if (Memory.notificationShown)
            {
                InformationDisplay.HideNotification(notificationGrid, notificationTextBlock);
            }
            else
            {
                InformationDisplay.ShowNotification(testTextBox.Text, notificationGrid, notificationTextBlock);
            }
        }

        private void testWarningButton_Click(object sender, RoutedEventArgs e)
        {
            if (Memory.warningShown)
            {
                InformationDisplay.HideWarning(warningGrid, warningTextBlock);
            }
            else
            {
                InformationDisplay.ShowWarning(testTextBox.Text, warningGrid, warningTextBlock);
            }
        }

        private void testErrorButton_Click(object sender, RoutedEventArgs e)
        {
            if (Memory.errorShown)
            {
                InformationDisplay.HideError(errorGrid, errorTextBlock);
            }
            else
            {
                InformationDisplay.ShowError(testTextBox.Text, errorGrid, errorTextBlock);
            }
        }

        #endregion
    }
}
